import request from '@/utils/request'

export function getAllFilesByPage(pageNum,pageSize){
    return request({
        url:'/file/allByPage?pageNum='+pageNum+'&pageSize='+pageSize,
        method:'get'
    })
}

export function fetchSingleFile(fileId) {
    return request({
        url: `/file/${fileId}`,
        method: 'get'
    })
}


export function uploadFile(data) {
    return request({
        url:'/file/save',
        method:'post',
        data
    })
}

export function updateFile(data) {
    return request({
        url:'/file/update',
        method:'post',
        data
    })
}


export function deleteFile(fileId){
    return request({
        url: `/file/delete/${fileId}`,
        method:'delete'
    })
}


export function getPath(data){
    return request({
        url: `/transfer/upload`,
        method:'post',
        dataType:'json',
        contentType:'multipart/form-data',
        type:'text/plain',
        data
    })
}


